<%--
  Created by IntelliJ IDEA.
  User: hp
  Date: 2019/1/9
  Time: 16:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>采购进货</title>
    <jsp:include page="${pageContext.request.contextPath}/common/tag.jsp"/>
    <style>
        ul li {
            list-style: none;
        }
    </style>
    <script>
        $(function () {
           /* $.post("{pageContext.request.contextPath}/lskc/delete",function (data) {})*/

            /*绑定分类下拉数据*/
            $.post("${pageContext.request.contextPath}/fenlei/queryfenlei",function (data) {
                $.each(data,function (index,item) {
                    $("#typeid").append("<option value=\""+item.fid+"\">"+item.fname+"</option>")
                    $("#fenlei").append("<option value=\""+item.fid+"\">"+item.fname+"</option>")
                })
            });
            /*绑定下拉数据*/
            $.post("${pageContext.request.contextPath}/brand/query",function (data) {
                $.each(data,function (index,item) {
                    $("#brandid").append("<option value=\""+item.bid+"\">"+item.bname+"</option>")
                    $("#pinpai").append("<option value=\""+item.bid+"\">"+item.bname+"</option>")
                })
            });
            /*绑定员工下拉数据*/
            $.post('${pageContext.request.contextPath}/worker/query',function (data) {
                $.each(data,function (index,item) {
                    $("#staffid").append("<option value=\""+item.yId+"\">"+item.yName+"</option>")
                    //$("#dianpu").append("<option value=\""+item.shopId+"\">"+item.shopName+"</option>")
                })
            })
            /*绑定供货商下拉数据*/
            $.post('${pageContext.request.contextPath}/supplier/getsupplier',function (data) {
                $.each(data,function (index,item) {
                    $("#ghsname").append("<option value=\""+item.id+"\">"+item.gname+"</option>")
                    //$("#dianpu").append("<option value=\""+item.shopId+"\">"+item.shopName+"</option>")
                })
            })

            var dingdan = '<%= session.getAttribute("dingdan")%>';
            var yingfu = '<%= session.getAttribute("zongqian")%>';
            $("#danhao").val(dingdan);
            $("#yingfu").html(yingfu);
            //alert(dingdan);
            if(dingdan=='null'){
                $.post('${pageContext.request.contextPath}/kucun/getdingdan',function (data) {
                    $("#danhao").val(data.dingdan);
                });
            }
            if(yingfu =='null'){
                $("#yingfu").html(0);
            }
            /*页面加载*/
            $("#mytable").bootstrapTable({
                url : '${pageContext.request.contextPath}/lskc/getInfoByDD',
                toolbar : '#addold #addnew',
                height : 700,
                queryParams:function(params){
                    var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                        danhao : $("#danhao").val()
                    };
                    return temp;
                },
                columns : [
                    {field : 'sid',title : '商品编号',align : 'center'},
                    {field : 'sname',title : '商品名称',align : 'center'},
                    {field : 'size',title : '尺寸',align : 'center'},
                    {field : 'jinjia',title : '商品进价',align : 'center'},
                    {field : 'jhnum',title : '进货数量',align : 'center'},
                    {field : 'brand.bname',title : '品牌',align : 'center'},
                    {field : 'color',title : '颜色',align : 'center'},
                    {field : 'supplier.gname',title : '供货商',align : 'center'},
                    {field : 'zongjine',title : '总金额',align : 'center'},
                    {title:'操作',align : 'center',
                        formatter: function (index,row,value) {
                            return  "<button onclick=\"lsshanchu2("+row.lsid+")\"  class=\"btn btn-primary\">删除</button>&nbsp;&nbsp;&nbsp;";
                        }
                    }
                ]
            })
            /*添加老的模态框加载完毕*/
            $("#oldmodal").on('show.bs.modal',function () {
                /*信息表单*/
                $("#oldtable").bootstrapTable({
                    url : '${pageContext.request.contextPath}/kucun/query',
                    toolbar : '#addkucun',
                    striped :true,
                    pageSize : 5,
                    pageList : [2,4,8,16],
                    pageNumber : 1,
                    height : 300,
                    pagination : true,
                    sidePagination:'server',  //启用服务器端分页
                    queryParams:function(params){
                        var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                            limit: params.limit,  //页面大小
                            offset: params.offset, //页码
                            name:$("#shopname").val(),
                            typeid:$("#typeid").val(),
                            sbrand:$("#brandid").val()
                        };
                        return temp;
                    },
                    columns : [
                        {checkbox:true},
                        //{field : 'kid',title : '编号',align : 'center'},
                        {field : 'sid',title : '商品编号',align : 'center'},
                        {field : 'sname',title : '商品名称',align : 'center'},
                        {field : 'ssize',title : '尺寸',align : 'center'},
                        {field : 'scolor',title : '颜色',align : 'center'},
                        {field : 'fenlei.fname',title : '分类',align : 'center'},
                        {field : 'brand.bname',title : '品牌',align : 'center'},
                        {field : 'goldMoney',title : '进价',align : 'center'},
                        {field : 'saleMoney',title : '售价',align : 'center'},
                        {field : 'stockNum',title : '库存数量',align : 'center'},
                        {title:'操作',align:'center',
                            formatter : function (value,row,index) {
                                return "<button class=\"btn btn-danger\" onclick=\"addnum("+index+")\" > <span class=\"glyphicon glyphicon-plus\"></span>&nbsp;&nbsp;采购<tton>"

                            }
                        }
                    ]
                })
            })
            /*当输入完数量加入临时表  pdid=0*/
            /*输入完进货数量后*/
            $("#lslstable").bootstrapTable({
                url : '',
                height : 300,
                queryParams:function(params){
                    var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                        danhao : $("#danhao").val()
                    };
                    return temp;
                },
                columns : [
                    {field : 'sid',title : '商品编号',align : 'center'},
                    {field : 'sname',title : '商品名称',align : 'center'},
                    {field : 'size',title : '尺寸',align : 'center'},
                    {field : 'jinjia',title : '商品进价',align : 'center'},
                    {field : 'jhnum',title : '进货数量',align : 'center'},
                    {field : 'brand.bname',title : '品牌',align : 'center'},
                    {field : 'color',title : '颜色',align : 'center'},
                    {field : 'supplier.gname',title : '供货商',align : 'center'},
                    {field : 'zongjine',title : '总金额',align : 'center'},
                    {title:'操作',align : 'center',
                        formatter: function (index,row,value) {
                            return  "<button onclick=\"lslsshan("+row.lsid+")\"  class=\"btn btn-primary\">删除</button>&nbsp;&nbsp;&nbsp;";
                        }
                    }
                ]
            })

            /*添加新商品校验*/
            $('#shopform').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    sName: {
                        message: '请输入商品名称',
                        validators: {
                            notEmpty: {
                                message: '商品名称不能为空！'
                            }
                        }
                    },
                    size: {
                        message: '请输入商品尺寸',
                        validators: {
                            notEmpty: {
                                message: '请输入商品尺寸！'
                            }
                        }
                    },
                    color: {
                        message: '请输入商品颜色',
                        validators: {
                            notEmpty: {
                                message: '请输入商品颜色！'
                            }
                        }
                    },
                    fenlei: {
                        message: '类型校验失败',
                        validators: {
                            notEmpty: {
                                message: '商品分类不能为空！'
                            },
                            callback: {
                                message: '必须选择一个类型',
                                callback: function(value, validator) {
                                    if (value == 0) {
                                        return false;
                                    } else {
                                        return true;
                                    }

                                }
                            }
                        }
                    },
                    pinpai: {
                        message: '类型校验失败',
                        validators: {
                            notEmpty: {
                                message: '商品品牌不能为空！'
                            },
                            callback: {
                                message: '请选择一个品牌',
                                callback: function(value, validator) {
                                    if (value == 0) {
                                        return false;
                                    } else {
                                        return true;
                                    }

                                }
                            }
                        }
                    },
                    jinjia: {
                        validators: {
                            notEmpty: {
                                message: '请输入商品进价金额！'
                            },
                            numeric: {message: '进价金额只能输入数字'}
                        }
                    },
                    shoujia: {
                        validators: {
                            notEmpty: {
                                message: '请输入商品售价金额！'
                            },
                            numeric: {message: '售价金额只能输入数字'}
                        }
                    },
                    jhnum: {
                        validators: {
                            notEmpty: {
                                message: '请输入商品库存数量！'
                            },
                            callback: {
                                message: '库存数量不能为0',
                                callback: function(value, validator) {
                                    if (value == 0) {
                                        return false;
                                    } else {
                                        return true;
                                    }
                                }
                            },
                            numeric: {message: '库存数量只能输入数字'}
                        }
                    },
                    ghsname: {
                        message: '类型校验失败',
                        validators: {
                            notEmpty: {
                                message: '供货商不能为空！'
                            },
                            callback: {
                                message: '请选择一个供货商',
                                callback: function(value, validator) {
                                    if (value == 0) {
                                        return false;
                                    } else {
                                        return true;
                                    }

                                }
                            }
                        }
                    },
                }
            });
        })
    </script>
</head>
<body style="margin: 10px 20px;">
    <%--add仓库临时表的单号--%>
    <input type="hidden" id="danhao">

    <div class="">
        <button class="btn btn-primary" id="addold" data-toggle="modal" href="#oldmodal">添加老商品</button>
        <button class="btn btn-primary" id="addnew" data-toggle="modal" href="#newmodal">添加新商品</button>
        <%--<button class="btn btn-primary" id="qingkong" onclick="qingkong()">清空商品</button>--%>
        <table id="mytable"></table>

        <div>
            <ul style="overflow: hidden;margin-top: 20px;">
                <li style="font-size: 20px;float: left;">应收金额：<span style="color: red;" id="yingfu">0</span></li>
                <li style="font-size: 20px;float: left;margin-left: 100px;">实收金额：<input type="text" id="shishou" value="" size="2px;"></li>
                <li style="font-size: 20px;float: left;margin-left: 100px;">经办人：
                    <select name="" id="staffid">
                        <option value="0">请选择</option>

                    </select>
                </li>
            </ul>
            <p style="font-size: 20px;margin-left: 40px;margin-top: 20px;">
              备注：<textarea style="vertical-align:top" name="" id="beizhu" cols="60" rows="4"></textarea>
            </p>
            <button class="btn btn-primary" style="position: relative;left: 760px;top: -50px;" onclick="jinhuo()">进货</button>
        </div>



    </div>
    <div class="modal fade bs-example-modal-lg" id="oldmodal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content" style="padding: 20px 50px;width: 1200px;height:900px;margin-left: -160px;">
                <form class="form-inline" style="margin-top: 20px;text-align: center">
                    <div class="form-group">
                        <label style="font-size: 15px;">商品分类：</label>&nbsp;
                        <select name="type" id="typeid" class="form-control">
                            <option value="0">全部</option>
                        </select>
                    </div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <div class="form-group">
                        <label style="font-size: 15px;">品牌：</label>&nbsp;
                        <select name="shop" id="brandid" class="form-control">
                            <option value="0">全部</option>
                        </select>
                    </div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <div class="form-group">
                        <label for="shopname">商品名称：</label>&nbsp;
                        <input type="text" class="form-control" id="shopname" placeholder="三只松鼠" style="height: 40px;">
                    </div>
                    <button onclick="serch();" class="btn btn-primary btn-lg" type="button"><span class="glyphicon glyphicon-search">搜索</span></button>
                </form>
                <table id="oldtable"></table>

                <table id="lslstable"></table>

                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="updatePdid()">保存</button>
                </div>
            </div>
        </div>
    </div>

    <%--addnew商品--%>
    <div class="modal fade" id="newmodal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">添加新商品</h4>
                </div>
                <div class="modal-body">
                    <form id="shopform" class="form-horizontal"  method="post" role="form">
                        <%--商品id--%>
                        <input type="hidden" value=""  id="id">
                        <%--得到当前页码--%>
                        <%--<input type="hidden" name="pn">--%>
                            <input type="hidden" name="dingdan" id="dingdan">
                        <div class="form-group">
                            <label for="sname">商品名称：</label>
                            <input type="text" class="form-control" name="sname" id="sname" placeholder="请输入商品名称">
                        </div>
                        <div class="form-group">
                            <label for="size">尺寸：</label>
                            <input type="text" class="form-control" name="size" id="size" placeholder="请输入尺寸">
                        </div>
                        <div class="form-group">
                            <label for="color">颜色：</label>
                            <input type="text" class="form-control" name="color" id="color" placeholder="请输入尺寸">
                        </div>
                        <div class="form-group">
                            <label for="fenlei">商品分类：</label>
                            <select class="form-control" name="fenlei" id="fenlei">
                                <option value="0">请选择</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="pinpai">商品品牌：</label>
                            <select class="form-control" name="pinpai" id="pinpai">
                                <option value="0">请选择</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="jinjia">进价：</label>
                            <input type="text" class="form-control" name="jinjia" id="jinjia" placeholder="10">
                        </div>
                        <div class="form-group">
                            <label for="shoujia">售价：</label>
                            <input type="text" class="form-control" name="shoujia" id="shoujia" placeholder="10">
                        </div>
                        <div class="form-group">
                            <label for="jhnum">增加库存：</label>
                            <input type="text" class="form-control" name="jhnum" id="jhnum" placeholder="10">
                        </div>
                            <div class="form-group">
                                <label for="ghsname">供货商：</label>
                                <select class="form-control" name="ghsname" id="ghsname">
                                    <option value="0">请选择</option>
                                </select>
                            </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="tianjia()">添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <%--输入购买数量--%>
    <div class="modal inmodal" id="shurunum" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content animated bounceInRight">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                    </button>
                    <i class="fa fa-laptop modal-icon"></i>
                    <h4 class="modal-title">输入购买数量</h4>
                </div>
                <div class="modal-body" style="overflow: hidden">
                    <div>
                        <p class="col-sm-4">商品名称： <span style="color: red" id="spname">沙哈舍维奇尔</span></p>
                        <p class="col-sm-3">尺寸： <span style="color: red" id="ssize">XXXXL</span></p>
                        <p class="col-sm-3">颜色： <span style="color: red" id="scolor">红色</span></p>
                        <p class="col-sm-4">品牌： <span style="color: red" id="spinpai">杀气龙</span></p>
                        <p class="col-sm-10">请输入进货数量：
                            <input type="text" id="num" value="1" class="form-control">
                            <input type="hidden" id="kid">
                        </p>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="baocun()">保存</button>
                </div>
            </div>
        </div>
    </div>

</body>
<script>
    /*清空session的值*/
    $.post('${pageContext.request.contextPath}/lskc/qsession',function (data) {});
    /*添加新商品模态框打开出发函数*/
    $("#newmodal").on('show.bs.modal',function () {
        document.getElementById("shopform").reset();
        $("#shopform").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
        var danhao = $("#danhao").val();
        $("#dingdan").val(danhao);
    })
    /*添加新商品*/
    function tianjia() {
        //启用较验
        $("#shopform").data("bootstrapValidator").validate();
        //验证是否通过true/false
        var flag = $("#shopform").data("bootstrapValidator").isValid() ;
        if(flag){
            //序列化表单
            var formStr=$("#shopform").serialize();
            //处理表单控件的中文乱码
            params = decodeURIComponent(formStr,true);
            console.log(params);
            $.ajax({
                type : 'post',
                url : '${pageContext.request.contextPath}/lskc/insert',
                data : params,
                success : function (data) {
                    document.getElementById("shopform").reset();
                    $("#shopform").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                    /*隐藏对话框*/
                    $("#newmodal").modal('hide');
                    $("#mytable").bootstrapTable('load',data.lslist);
                    $("#yingfu").html(data.moeny);
                    //提示增加成功
                    swal("提示信息", "增加成功!", "success");
                }
            })
        }else{
        }
    }
    
    
    /*点击搜索*/
    function serch() {
        //返回表格的 Options。
        var opts = $("#oldtable").bootstrapTable("getOptions") ;
        var limit = opts.pageSize ;
        var offset = (opts.pageNumber-1) * limit;
        var name = $("#shopname").val() ;
        var typeid = $("#typeid").val();
        var brandid = $("#brandid").val();
        $.post("${pageContext.request.contextPath}/kucun/query",{'name':name,'typeid':typeid,'sbrand':brandid,'limit':limit,'offset':offset},function (data) {
            // var mydata = eval("("+data+")") ;
            //重新绑定表格数据
            $("#oldtable").bootstrapTable('load',data) ;
        })
    }
    
    function addnum(index) {
        $("#shurunum").modal('show');
        $("#oldtable").bootstrapTable("uncheckAll");
        $("#oldtable").bootstrapTable("check",index);
        var rows = $("#oldtable").bootstrapTable('getSelections')[0];
        console.log(rows);
        $("#kid").val(rows.kid);
        $("#spname").html(rows.sname);
        $("#ssize").html(rows.ssize);
        $("#scolor").html(rows.scolor);
        $("#spinpai").html(rows.brand.bname);
    }

    function baocun() {
        var kid = $("#kid").val();
        var danhao = $("#danhao").val();
        var num = $("#num").val();
        $()
        $.post('${pageContext.request.contextPath}/kucun/getinfoBykid',{"kid":kid,"danhao":danhao,"num":num},function (data) {
            console.log(data);
            if(data.row == 1){
                $("#shurunum").modal('hide');
                $("#lslstable").bootstrapTable('load',data.ling);
            }
        })
    }
    /*当添加老商品模态框隐藏式删除*/
    $("#oldmodal").on('hidden.bs.modal',function () {
        var danhao = $("#danhao").val();
        $.post('${pageContext.request.contextPath}/lskc/deleteByDingdan',{'danhoa':danhao},function (data) {
            
        })
    })
    /*当点击添加老商品时 从新绑定pdid 为0的表格*/
    $("#oldmodal").on('show.bs.modal',function () {
        $.post('${pageContext.request.contextPath}/lskc/getInfoByDD',function (data) {
            $("#lslstable").bootstrapTable('load',data);
        })
    })
    /*当添加完以后 把改单号的所有pid修改为1*/
    function updatePdid() {
        var danhao = $("#danhao").val();
        $.post('${pageContext.request.contextPath}/lskc/updatePidBydh',{"danhao":danhao},function (data) {
            console.log(data);
            if(data.row>0){
                $("#mytable").bootstrapTable('load',data.lskList);
                $("#oldmodal").modal('hide');
                $("#yingfu").html(data.yingfu);

                swal("提示信息", "添加成功!", "success");
            }
        })
    }
    /*临时删除*/
    function lsshanchu(lsid) {
        var danhao = $("#danhao").val();
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        },function () {
            $.post('${pageContext.request.contextPath}/lskc/deleteByzizeng',{"lsid":lsid,"danhao":danhao},function (data) {
                console.log(data);
                if(data.row>0){
                    $("#mytable").bootstrapTable('load',data.pdidyisc);
                    if(data.money=='null'){
                        $("#yingfu").html(0);
                    }
                    $("#yingfu").html(data.money);
                    swal("提示信息", "删除成功!", "success");
                }
            })
        });
    }

    /*临时删除*/
    function lsshanchu2(lsid) {
        var danhao = $("#danhao").val();
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        },function () {
            $.post('${pageContext.request.contextPath}/lskc/deleteByzizeng2',{"lsid":lsid,"danhao":danhao},function (data) {
                console.log(data);
                if(data.row>0){
                    $("#mytable").bootstrapTable('load',data.pdidyisc);
                    if(data.money=='null'){
                        $("#yingfu").html(0);
                    }
                    $("#yingfu").html(data.money);
                    swal("提示信息", "删除成功!", "success");
                }
            })
        });
    }
    /*临时中的临时删除*/
    function lslsshan(lsid) {
        var danhao = $("#danhao").val();
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        },function () {
            $.post('${pageContext.request.contextPath}/lskc/deleteByzizeng',{"lsid":lsid,"danhao":danhao},function (data) {
                if(data.row>0){
                    $("#lslstable").bootstrapTable('load',data.schlist);
                    swal("提示信息", "删除成功!", "success");
                }
            })
        });
    }
    
    function jinhuo() {
        var danhao = $("#danhao").val();
        var yingshou = parseFloat($("#yingfu").html());
        var shishou = $("#shishou").val();
        var jbren = $("#staffid").val();
        var beizhu = $("#beizhu").val();
        if(yingshou==0){
            swal("提示信息", "请选购商品!", "error");
        } else if(shishou == ''){
            alert("请输入实收金额");
            return false;
        } else if(shishou<yingshou){
            alert("实收金额应该大于应收金额");
            return false;
        }else if(jbren == 0){
            alert("请选择经办人");
            return false;
        } else{
            $.post('${pageContext.request.contextPath}/audit/cgshenhe',{'danhao':danhao,'yingshou':yingshou,'shishou':shishou,'jbren':jbren,'beizhu':beizhu},function (data) {
                if(data.row >0){
                    /*$("#mytable").bootstrapTable('destroy');
                    $("#yingfu").html(0);
                    $("#shishou").val(0);
                    $("#staffid").val(0);
                    $("#beizhu").val("");*/
                    $.post('${pageContext.request.contextPath}/kucun/getdingdan',function (data) {
                        $("#danhao").val(data.dingdan);
                       //$("#mytable ").bootstrapTable('load',data.lslist);
                    });
                    alert("单号："+danhao+"------提交成功等待审核!");
                    window.location.reload();
                }
            })
        }
    }

    function qingkong() {
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        },function () {
            var row = $("#mytable").bootstrapTable('getSelections');
            console.log(row);
            /*$.post('{pageContext.request.contextPath}/lskc/deleteByzizeng',{"lsid":lsid,"danhao":danhao},function (data) {
                if(data.row>0){
                    $("#lslstable").bootstrapTable('load',data.schlist);
                    swal("提示信息", "删除成功!", "success");
                }
            })*/
        });
    }
</script>
</html>
